﻿using BW.IBLL;
using BW.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BW.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class EmployeesController : ControllerBase, IEmployeeBLL
    {
        public EmployeesController(IEmployeeBLL employeeBLL)
        {
            EmployeeBLL = employeeBLL;
        }

        public IEmployeeBLL EmployeeBLL { get; }

        [HttpPost]
        public async Task<int> AddEmployee(Employee employee)
        {
            return await EmployeeBLL.AddEmployee(employee);
        }

        [HttpGet]
        public Employee Login(string name, string pwd)
        {
            return EmployeeBLL.Login(name, pwd);    
        }
    }
}
